package com.zyz.K_集合.Map接口三TreeMap;

import java.util.Set;
import java.util.TreeMap;

/**
 * @author: vick
 * @Date: 2025/3/30
 * @Description:
 * @version: 1.0
 */
public class UserTest {
    public static void main(String[] args) {
        TreeMap treeMap = new TreeMap();
        treeMap.put(new User("vick", 18), 18);
        treeMap.put(new User("Tom", 28), 28);
        treeMap.put(new User("lili", 38), 38);
        treeMap.put(new User("nana", 18), 18);

        Set entrySet = treeMap.entrySet();
        for (Object obj : entrySet) {
            System.out.println(obj);
        }
    }
}
